<style>
    .tabs{
        background: #fff;
        margin-top: 20px;
    }
    .tabs-content{
        display: flex;
        flex-direction: column-reverse;
        padding-top: 20px;
        width: 95%;
        margin: auto;
    }
    .tabs-content .tab .left{
        width: 25%;
        float: left;
    }
    .tabs-content .tab .right{
        width: 25%;
        float: left;
    }
    .tabs-content .tab .zhong{
        width: 25%;
        float: left;
    }
    .tab-labels{
        /*padding: 10px;*/
        box-sizing: border-box;
        background: #e3eced;
        display: flex;
        align-items: center;
        font-size: 14px;
        color: #666;
    }
    .tab-labels .xian {
        width: 8px;
        height: 20px;
        background: #18bc9c;
        margin-right: 10px;
        margin-left: 10px;
    }

    .tabs .col-sm-2{
        width: 100%;
        text-align: left;
    }
</style>
<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
    <div class="tabs">
        <div class="tab-labels">
            <div class="xian"></div>
            全单批改
        </div>
        <div class="tabs-content">
            <div id="tab1" class="tab active">
                <div class="left">
                    <div class="form-group">
                        <label class="control-label col-xs-12 col-sm-2">{:__('服务单号')}:</label>
                        <div class="col-xs-12 col-sm-10">
                            <input id="tong_number" class="form-control" name="tong_number" type="text" value="">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-xs-12 col-sm-2">{:__('车牌号')}:</label>
                        <div class="col-xs-12 col-sm-10">
                            <input id="car_num" class="form-control" name="car_num" type="text" value="">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-xs-12 col-sm-2">{:__('修改日期')}:</label>
                        <div class="col-xs-12 col-sm-10">
                            <input id="canri" class="form-control datetimepicker" data-date-format="YYYY-MM-DD" data-use-current="true" name="canri" type="text" value="{:date('Y-m-d')}" readonly>
                        </div>
                    </div>

                </div>
                <div class="zhong">
                    <div class="form-group">
                        <label class="control-label col-xs-12 col-sm-2">{:__('发动机号')}:</label>
                        <div class="col-xs-12 col-sm-10">
                            <input id="car_engine" class="form-control" name="car_engine" type="text" value="">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-xs-12 col-sm-2">{:__('车架号')}:</label>
                        <div class="col-xs-12 col-sm-10">
                            <input id="car_vin" class="form-control" name="car_vin" type="text" value="">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-xs-12 col-sm-2">{:__('批单状态')}<span style="color:red">*</span>:</label>
                        <div class="col-xs-12 col-sm-10">
                            <select name="batch_state" id="batch_state" class="form-control">
                                <option value="" selected>请选择状态</option>
                                <option value="2">改单</option>
                                <option value="1">退单</option>
                                <option value="3">增单</option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="right">
                    <div class="form-group " style="margin-top: 50px;padding-bottom: 50px;">
                        <label class="control-label col-xs-12 col-sm-2"></label>
                        <div class="col-xs-12 " style="margin: auto;margin-top: 125px;">
                            <button  class="tab-label1 btn btn-primary btn-embossed" style="width:100px;" type="button" onclick="xiayibu()">下一步</button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</form>

<script>
    function xiayibu(){
        if($('#tong_number').val()=="" && $('#car_num').val()=="" && $('#car_engine').val()=="" && $('#car_vin').val()==""){
            layer.alert("必须填一个！");
            return false;
        }else if($('#batch_state').val() == ""){
            layer.alert("请选择批单状态！");
            return false;
        }
        var formData = $("#add-form").serialize();
        $.ajax({
            type: 'get',
            url: "{:url('lists/pigai/chaxun')}", //发送路径
            data: formData, //发送的数据
            async: false, //是否异步
            success: function (res) {
                if (res.code == 1) {
                    layer.closeAll()
                    parent.layer.closeAll();
                    parent.Backend.api.open("{:url('lists/pigai/allp')}?" + formData, '批改操作', {area: ['100%', '100%']});
                } else {
                    layer.alert(res.msg)
                }
            }
        })

    }

</script>
